//
//  NetworkMonitor.swift
//  SwiftProject
//
//  Created by qindong on 2021/5/7.
//

import UIKit

class NetworkMonitor: NSObject {
    static let shared = NetworkMonitor()
    private override init() {
        
    }
    func netWorkReachability(_ reachabilityStatus: @escaping(_ status : NetworkReachabilityManager.NetworkReachabilityStatus) -> Void) {
        DispatchQueue.main.async {
            NetworkReachabilityManager()!.startListening { status in
                reachabilityStatus(status)
            }
        }
    }
}
